package com.zy.dp.observer.example4;

import java.util.Observable;
import java.util.Observer;

public class Reader implements Observer
{
	private String name;

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	@Override
	public void update(Observable o, Object obj)
	{
		System.out.println(name + "收到报纸了，先阅读它。目标推过来的内容是===" + obj);

		System.out.println(name + "收到报纸了，先阅读它。主动到目标拉过来的内容是==="
				+ ((NewsPaper) o).getContent());

	}

}
